<<<<<<< .mine
module editphrase(editphrase, phrasestarted, phrase0, phrase1, entry, keydata, clk);
=======
module editphrase(editphrase, phrase0, phrase1, entry, keydata, hex2, hex3, hex4, hex5, hex6, hex7);
>>>>>>> .r129

input[1:0] editphrase;
output phrasestarted;
reg phrasestarted;
output[127:0] phrase0;
reg[127:0] phrase0;
output[127:0] phrase1;
reg[127:0] phrase1;
input[15:0] entry;
input[16:0] keydata;

<<<<<<< .mine
reg [7:0] charhistory[1:32];
=======
reg[4:0] entrylength;

>>>>>>> .r129
reg[8:0] currentchar;

always @(*)
begin
<<<<<<< .mine
	if(phrasestarted == 1'b0)
		if(charhistory[1] != 8'h20)
			phrasestarted = 1'b1;
	
	case(editphrase)
		2'b00:
		begin
			currentchar = 9'h0FF;
			phrasestarted = 1'b0;
		end
		2'b01:
		begin
			currentchar = 9'h1FF;
			phrasestarted = 1'b0;
		end
		2'b10:
		begin
			case(keydata[15:0])
				pressedA: currentchar = {1'b1, uA};
				pressedB: currentchar = {1'b1, uB};
				pressedC: currentchar = {1'b1, uC};
				pressedD: currentchar = {1'b1, uD};
				pressedE: currentchar = {1'b1, uE};
				pressedF: currentchar = {1'b1, uF};
				pressedG: currentchar = {1'b1, uG};
				pressedH: currentchar = {1'b1, uH};
				pressedI: currentchar = {1'b1, uI};
				pressedJ: currentchar = {1'b1, uJ};
				pressedK: currentchar = {1'b1, uK};
				pressedL: currentchar = {1'b1, uL};
				pressedM: currentchar = {1'b1, uM};
				pressedN: currentchar = {1'b1, uN};
				pressedO: currentchar = {1'b1, uO};
				pressedP: currentchar = {1'b1, uP};
				pressedQ: currentchar = {1'b1, uQ};
				pressedR: currentchar = {1'b1, uR};
				pressedS: currentchar = {1'b1, uS};
				pressedT: currentchar = {1'b1, uT};
				pressedU: currentchar = {1'b1, uU};
				pressedV: currentchar = {1'b1, uV};
				pressedW: currentchar = {1'b1, uW};
				pressedX: currentchar = {1'b1, uX};
				pressedY: currentchar = {1'b1, uY};
				pressedZ: currentchar = {1'b1, uZ};
				pressedSPACE: currentchar = 9'h120;
				pressedBACK: currentchar = 9'h1FF;
				default: currentchar = 9'h0FF;
			endcase
		end
		2'b11:
		begin
			currentchar = 9'h0FF;
		end
=======
	
	case(keydata[15:0])
		pressedA: currentchar = {1'b1, uA};
		pressedB: currentchar = {1'b1, uB};
		pressedC: currentchar = {1'b1, uC};
		pressedD: currentchar = {1'b1, uD};
		pressedE: currentchar = {1'b1, uE};
		pressedF: currentchar = {1'b1, uF};
		pressedG: currentchar = {1'b1, uG};
		pressedH: currentchar = {1'b1, uH};
		pressedI: currentchar = {1'b1, uI};
		pressedJ: currentchar = {1'b1, uJ};
		pressedK: currentchar = {1'b1, uK};
		pressedL: currentchar = {1'b1, uL};
		pressedM: currentchar = {1'b1, uM};
		pressedN: currentchar = {1'b1, uN};
		pressedO: currentchar = {1'b1, uO};
		pressedP: currentchar = {1'b1, uP};
		pressedQ: currentchar = {1'b1, uQ};
		pressedR: currentchar = {1'b1, uR};
		pressedS: currentchar = {1'b1, uS};
		pressedT: currentchar = {1'b1, uT};
		pressedU: currentchar = {1'b1, uU};
		pressedV: currentchar = {1'b1, uV};
		pressedW: currentchar = {1'b1, uW};
		pressedX: currentchar = {1'b1, uX};
		pressedY: currentchar = {1'b1, uY};
		pressedZ: currentchar = {1'b1, uZ};
		pressedSPACE: currentchar = 9'h120;
		pressedBACK: currentchar = 9'h1FF;
		default: currentchar = 9'h0FF;
>>>>>>> .r129
	endcase
end

reg [7:0] charhistory[1:32];

always @(posedge currentchar[8])
begin
<<<<<<< .mine
	if (currentchar == 9'h1FF)
=======
	if (editphrase == 2'b00)
>>>>>>> .r129
	begin
<<<<<<< .mine
		charhistory[32] <= 8'h20;
		charhistory[31] <= 8'h20;
		charhistory[30] <= 8'h20;
		charhistory[29] <= 8'h20;
		charhistory[28] <= 8'h20;
		charhistory[27] <= 8'h20;
		charhistory[26] <= 8'h20;
		charhistory[25] <= 8'h20;
		charhistory[24] <= 8'h20;
		charhistory[23] <= 8'h20;
		charhistory[22] <= 8'h20;
		charhistory[21] <= 8'h20;
		charhistory[20] <= 8'h20;
		charhistory[19] <= 8'h20;
		charhistory[18] <= 8'h20;
		charhistory[17] <= 8'h20;
		charhistory[16] <= 8'h20;
		charhistory[15] <= 8'h20;
		charhistory[14] <= 8'h20;
		charhistory[13] <= 8'h20;
		charhistory[12] <= 8'h20;
		charhistory[11] <= 8'h20;
		charhistory[10] <= 8'h20;
		charhistory[9] <= 8'h20;
		charhistory[8] <= 8'h20;
		charhistory[7] <= 8'h20;
		charhistory[6] <= 8'h20;
		charhistory[5] <= 8'h20;
		charhistory[4] <= 8'h20;
		charhistory[3] <= 8'h20;
		charhistory[2] <= 8'h20;
		charhistory[1] <= 8'h20;
	end
	else if (currentchar[7:0] != 8'hFF && currentchar[8] == 1'b1)
	begin
		charhistory[32] <= charhistory[31];
		charhistory[31] <= charhistory[30];
		charhistory[30] <= charhistory[29];
		charhistory[29] <= charhistory[28];
		charhistory[28] <= charhistory[27];
		charhistory[27] <= charhistory[26];
		charhistory[26] <= charhistory[25];
		charhistory[25] <= charhistory[24];
		charhistory[24] <= charhistory[23];
		charhistory[23] <= charhistory[22];
		charhistory[22] <= charhistory[21];
		charhistory[21] <= charhistory[20];
		charhistory[20] <= charhistory[19];
		charhistory[19] <= charhistory[18];
		charhistory[18] <= charhistory[17];
		charhistory[17] <= charhistory[16];
		charhistory[16] <= charhistory[15];
		charhistory[15] <= charhistory[14];
		charhistory[14] <= charhistory[13];
		charhistory[13] <= charhistory[12];
		charhistory[12] <= charhistory[11];
		charhistory[11] <= charhistory[10];
		charhistory[10] <= charhistory[9];
		charhistory[9] <= charhistory[8];
		charhistory[8] <= charhistory[7];
		charhistory[7] <= charhistory[6];
		charhistory[6] <= charhistory[5];
		charhistory[5] <= charhistory[4];
		charhistory[4] <= charhistory[3];
		charhistory[3] <= charhistory[2];
		charhistory[2] <= charhistory[1];
		charhistory[1] <= currentchar;
	end
end

always@(*)
begin
=======
		if (currentchar == 9'h1FF)
		begin
			charhistory[32] <= 8'h20;
			charhistory[31] <= 8'h20;
			charhistory[30] <= 8'h20;
			charhistory[29] <= 8'h20;
			charhistory[28] <= 8'h20;
			charhistory[27] <= 8'h20;
			charhistory[26] <= 8'h20;
			charhistory[25] <= 8'h20;
			charhistory[24] <= 8'h20;
			charhistory[23] <= 8'h20;
			charhistory[22] <= 8'h20;
			charhistory[21] <= 8'h20;
			charhistory[20] <= 8'h20;
			charhistory[19] <= 8'h20;
			charhistory[18] <= 8'h20;
			charhistory[17] <= 8'h20;
			charhistory[16] <= 8'h20;
			charhistory[15] <= 8'h20;
			charhistory[14] <= 8'h20;
			charhistory[13] <= 8'h20;
			charhistory[12] <= 8'h20;
			charhistory[11] <= 8'h20;
			charhistory[10] <= 8'h20;
			charhistory[9] <= 8'h20;
			charhistory[8] <= 8'h20;
			charhistory[7] <= 8'h20;
			charhistory[6] <= 8'h20;
			charhistory[5] <= 8'h20;
			charhistory[4] <= 8'h20;
			charhistory[3] <= 8'h20;
			charhistory[2] <= 8'h20;
			charhistory[1] <= 8'h20;
		end
	end
	
	else if (editphrase == 2'b01)
	begin
		if (currentchar != 9'h0FF)
		begin
			charhistory[32] <= charhistory[31];
			charhistory[31] <= charhistory[30];
			charhistory[30] <= charhistory[29];
			charhistory[29] <= charhistory[28];
			charhistory[28] <= charhistory[27];
			charhistory[27] <= charhistory[26];
			charhistory[26] <= charhistory[25];
			charhistory[25] <= charhistory[24];
			charhistory[24] <= charhistory[23];
			charhistory[23] <= charhistory[22];
			charhistory[22] <= charhistory[21];
			charhistory[21] <= charhistory[20];
			charhistory[20] <= charhistory[19];
			charhistory[19] <= charhistory[18];
			charhistory[18] <= charhistory[17];
			charhistory[17] <= charhistory[16];
			charhistory[16] <= charhistory[15];
			charhistory[15] <= charhistory[14];
			charhistory[14] <= charhistory[13];
			charhistory[13] <= charhistory[12];
			charhistory[12] <= charhistory[11];
			charhistory[11] <= charhistory[10];
			charhistory[10] <= charhistory[9];
			charhistory[9] <= charhistory[8];
			charhistory[8] <= charhistory[7];
			charhistory[7] <= charhistory[6];
			charhistory[6] <= charhistory[5];
			charhistory[5] <= charhistory[4];
			charhistory[4] <= charhistory[3];
			charhistory[3] <= charhistory[2];
			charhistory[2] <= charhistory[1];
			charhistory[1] <= currentchar;
		end
		
		else if (currentchar == 9'h1FF)
		begin
			charhistory[32] = 8'h20;
			charhistory[31] = 8'h20;
			charhistory[30] = 8'h20;
			charhistory[29] = 8'h20;
			charhistory[28] = 8'h20;
			charhistory[27] = 8'h20;
			charhistory[26] = 8'h20;
			charhistory[25] = 8'h20;
			charhistory[24] = 8'h20;
			charhistory[23] = 8'h20;
			charhistory[22] = 8'h20;
			charhistory[21] = 8'h20;
			charhistory[20] = 8'h20;
			charhistory[19] = 8'h20;
			charhistory[18] = 8'h20;
			charhistory[17] = 8'h20;
			charhistory[16] = 8'h20;
			charhistory[15] = 8'h20;
			charhistory[14] = 8'h20;
			charhistory[13] = 8'h20;
			charhistory[12] = 8'h20;
			charhistory[11] = 8'h20;
			charhistory[10] = 8'h20;
			charhistory[9] = 8'h20;
			charhistory[8] = 8'h20;
			charhistory[7] = 8'h20;
			charhistory[6] = 8'h20;
			charhistory[5] = 8'h20;
			charhistory[4] = 8'h20;
			charhistory[3] = 8'h20;
			charhistory[2] = 8'h20;
			charhistory[1] = 8'h20;
		end
	
		else
		begin
			charhistory[32] <= charhistory[31];
			charhistory[31] <= charhistory[30];
			charhistory[30] <= charhistory[29];
			charhistory[29] <= charhistory[28];
			charhistory[28] <= charhistory[27];
			charhistory[27] <= charhistory[26];
			charhistory[26] <= charhistory[25];
			charhistory[25] <= charhistory[24];
			charhistory[24] <= charhistory[23];
			charhistory[23] <= charhistory[22];
			charhistory[22] <= charhistory[21];
			charhistory[21] <= charhistory[20];
			charhistory[20] <= charhistory[19];
			charhistory[19] <= charhistory[18];
			charhistory[18] <= charhistory[17];
			charhistory[17] <= charhistory[16];
			charhistory[16] <= charhistory[15];
			charhistory[15] <= charhistory[14];
			charhistory[14] <= charhistory[13];
			charhistory[13] <= charhistory[12];
			charhistory[12] <= charhistory[11];
			charhistory[11] <= charhistory[10];
			charhistory[10] <= charhistory[9];
			charhistory[9] <= charhistory[8];
			charhistory[8] <= charhistory[7];
			charhistory[7] <= charhistory[6];
			charhistory[6] <= charhistory[5];
			charhistory[5] <= charhistory[4];
			charhistory[4] <= charhistory[3];
			charhistory[3] <= charhistory[2];
			charhistory[2] <= charhistory[1];
			charhistory[1] <= currentchar;
		end
	end
end

always@(*)
begin
>>>>>>> .r129
	phrase0[7:0] 		= charhistory[32];
	phrase0[15:8] 		= charhistory[31];
	phrase0[23:16] 	= charhistory[30];
	phrase0[31:24] 	= charhistory[29];
	phrase0[39:32] 	= charhistory[28];
	phrase0[47:40] 	= charhistory[27];
	phrase0[55:48] 	= charhistory[26];
	phrase0[63:56] 	= charhistory[25];
	phrase0[71:64] 	= charhistory[24];
	phrase0[79:72] 	= charhistory[23];
	phrase0[87:80] 	= charhistory[22];
	phrase0[95:88] 	= charhistory[21];
	phrase0[103:96] 	= charhistory[20];
	phrase0[111:104] 	= charhistory[19];
	phrase0[119:112] 	= charhistory[18];
	phrase0[127:120] 	= charhistory[17];
	
	phrase1[7:0] 		= charhistory[16];
	phrase1[15:8] 		= charhistory[15];
	phrase1[23:16] 	= charhistory[14];
	phrase1[31:24] 	= charhistory[13];
	phrase1[39:32] 	= charhistory[12];
	phrase1[47:40] 	= charhistory[11];
	phrase1[55:48] 	= charhistory[10];
	phrase1[63:56] 	= charhistory[9];
	phrase1[71:64] 	= charhistory[8];
	phrase1[79:72] 	= charhistory[7];
	phrase1[87:80] 	= charhistory[6];
	phrase1[95:88] 	= charhistory[5];
	phrase1[103:96] 	= charhistory[4];
	phrase1[111:104] 	= charhistory[3];
	phrase1[119:112] 	= charhistory[2];
	phrase1[127:120] 	= charhistory[1];
end

<<<<<<< .mine
=======
blankHexDisplay disp2(hex2);
hexDisplay disp3({2'b00, editphrase}, hex3);
blankHexDisplay disp4(hex4);
blankHexDisplay disp5(hex5);
hexDisplay disp6(currentchar[3:0], hex6);
hexDisplay disp7(currentchar[7:4], hex7);

>>>>>>> .r129
parameter pressedA = 16'HF01C;
parameter pressedB = 16'HF032;
parameter pressedC = 16'hF021;
parameter pressedD = 16'hF023;
parameter pressedE = 16'hF024;
parameter pressedF = 16'hF02B;
parameter pressedG = 16'hF034;
parameter pressedH = 16'hF033;
parameter pressedI = 16'hF043;
parameter pressedJ = 16'hF03B;
parameter pressedK = 16'hF042;
parameter pressedL = 16'hF04B;
parameter pressedM = 16'hF03A;
parameter pressedN = 16'hF031;
parameter pressedO = 16'hF044;
parameter pressedP = 16'hF04D;
parameter pressedQ = 16'hF015;
parameter pressedR = 16'hF02D;
parameter pressedS = 16'Hf01B;
parameter pressedT = 16'Hf02C;
parameter pressedU = 16'hF03C;
parameter pressedV = 16'hF02A;
parameter pressedW = 16'hF01D;
parameter pressedX = 16'hF022;
parameter pressedY = 16'hF035;
parameter pressedZ = 16'hF01A;
parameter pressedENTER = 16'hF05A;
parameter pressedSPACE = 16'hF029;
parameter pressedBACK = 16'hF066;
parameter pressedLEFT = 16'hF06B;
parameter pressedRIGHT = 16'hF074;
parameter pressedUP = 16'hF075;
parameter pressedDOWN = 16'hF072;

parameter uA = 8'h41; // upper case A-Z
parameter uB = 8'h42;
parameter uC = 8'h43;
parameter uD = 8'h44;
parameter uE = 8'h45;
parameter uF = 8'h46;
parameter uG = 8'h47;
parameter uH = 8'h48;
parameter uI = 8'h49;
parameter uJ = 8'h4A;
parameter uK = 8'h4B;
parameter uL = 8'h4C;
parameter uM = 8'h4D;
parameter uN = 8'h4E;
parameter uO = 8'h4F;
parameter uP = 8'h50;
parameter uQ = 8'h51;
parameter uR = 8'h52;
parameter uS = 8'h53;
parameter uT = 8'h54;
parameter uU = 8'h55;
parameter uV = 8'h56;
parameter uW = 8'h57;
parameter uX = 8'h58;
parameter uY = 8'h59;
parameter uZ = 8'h5A;
	
endmodule